package com.whsxt.code;

import java.util.Scanner;

/**
 * @author CodeYang
 * @Description  从键盘输入一个班5个学生的分数，求和并输出
 * @Date 2020/12/5 20:51
 */
public class SumStudentScore {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        double[] scores = new double[5];
        double sumScores =0;
        System.out.println("请输入学生分数:");

        for (int i = 0; i < scores.length; i++) {
            System.out.print(i+1+"号学生:分数:");
            scores[i] = scanner.nextDouble();
            sumScores +=scores[i];
        }


        System.out.println("五位学生分数总和为:"+sumScores);
    }


}
